import React from "react";
import {
    Redirect
} from 'react-router-dom'

const BeforeEach = (props:any) => {
    let token = window.localStorage.getItem('token');
    return (
        <>
        <props.component {...props}></props.component>
        {
            !token&&<Redirect to="/login"></Redirect>
        }
        </>
    )
};

export default BeforeEach